<template>
    <div class="box">
        <div class="meessItem">
            <div class="title">
                {{ messageList[type].title }}
            </div>
            <div class="content">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{ messageList[type].content }}</div>
            <div class="time">{{ messageList[type].createTime }}</div>
        </div>
    </div>
</template>

<script setup>
import { appNotices, appNoticeInds } from '@/utils/api'
const router = useRoute()
const isdetail = ref(router.query.index)
const type =  ref(router.query.type)
const currentPage = ref(1)
const messageList = ref([])
// 获取系统公告
const appNoticeInd = () => {
    appNoticeInds({
        currentPage: currentPage.value
    }).then(res => {
        if (res.code == 200) {
            messageList.value = res.object
        }
    })
}
const appNotice = () => {
    appNotices({
        currentPage: currentPage.value
    }).then(res => {
        if (res.code == 200) {
            messageList.value = res.object
        }
    })
}
if(isdetail.value == 0){
	appNoticeInd()
}else{
	appNotice()
}
</script>

<style lang="scss" scoped>
.box {
    min-height: 100vh;
    background-color: #f5f5f5;
    line-height: 30px;
    padding: 10px;
    box-sizing: border-box;
    .meessItem {
        width: 98%;
        margin: 0 auto;
        background-color: #fff;
        padding: 8px 10px;
        box-sizing: border-box;
        border-radius: 6px;
        .title {
            font-size: 14px;
            font-family: Microsoft YaHei;
            font-weight: bold;
            color: #545454;
            opacity: 1;
            margin-bottom: 8px;
        }
        .content {
            font-size: 16px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: #545454;
            opacity: 1;
            margin-bottom: 2px;
        }
        .time {
            font-size: 12px;
            font-family: Microsoft YaHei;
            font-weight: 400;
            color: #545454;
            opacity: 1;
            text-align: end;
        }
    }
}
</style>
